#ifndef TIMELIBH
#define TIMELIBH

#include <stdio.h>
#include "NUC1xx.h"
#include "Driver\DrvSYS.h"
#include "Driver\DrvGPIO.h"
#include "LCD_Driver.h"
#include "Seven_Segment.h"
#include "ScanKey.h"

#define LCD_CLOCK_POS 1
#define LCD_DATE_POS 2
                                                                
typedef struct {
//clock
    int jam;
    int menit;
    int detik;
//date   
    int tanggal;
    int bulan;
    int tahun;
} xtime;

           
//---- Akses Real Time Clock 

//void RTCStart (void);

void RTCInit (xtime);
 
void RTCSetTime (xtime);

xtime RTCGetTime (void);

void RTCEnableAlarm(xtime);
void RTC_IRQHandler(void);

//---- Manipulasi Struct Time
char* getMonName(int mon);
void PrintClockString(xtime);
void PrintDateString(xtime);

int isKabisat(int );
int DayInMonth(int , int );
uint32_t timeDelta (xtime , xtime );
#endif



